package com.evildog.workspace.system.api.feign;

import com.evildog.workspace.common.result.Result;
import com.evildog.workspace.system.api.consts.SystemApiConst;
import com.evildog.workspace.system.api.vo.ApiPermissionVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * <p>
 * apiPermission feign
 * </p>
 *
 * @author evildog
 * @since 2020-07-25
 */
@FeignClient(
        contextId = "api-permission",
        value = SystemApiConst.SERVICE_NAME
)
public interface ApiPermissionClient {

    String API_PREFIX = "/api-permission-feign";

    /**
     * 获取系统所有api权限
     */
    @GetMapping(API_PREFIX + "/all")
    Result<List<ApiPermissionVO>> getAllPermissions();

    /**
     * 获取用户的api权限
     */
    @GetMapping(API_PREFIX + "/user")
    Result<List<ApiPermissionVO>> getUserPermissions(@PathVariable Long userId);

}